package electronicaDonPepe.comisiones.presentation;

import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServlet;

import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import electronicaDonPepe.comisiones.service.Service;

public class ServletBase extends HttpServlet {
	private static final long serialVersionUID = 1L;
     
	private Service serviceLayer;
	
	public Service getServiceLayer() {
		return serviceLayer;
	}

	public void init(ServletConfig config){
		ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(config.getServletContext()); 
		this.serviceLayer = (Service) ctx.getBean("serviceBean");
	}
}
